package com.punch.order.exception;

import com.punch.common.exception.ExceptionEnum;

/**
 * 系统模块自定义异常枚举
 *
 * @author cyd
 * @since 2019-12-05
 */
public enum OrderExceptionEnum implements ExceptionEnum {

    COURSE_AMOUNT_ERROR(3000, "订单金额有误"),

    CREATE_ORDER_ERROR(3001, "创建订单异常"),

    ORDER_NOT_EXIST(3002, "订单不存在"),

    ORDER_STATUS_ERROR(3003, "订单状态错误"),

    UNIFIEDORDER_PAY_ERROR(3004, "支付异常"),

    UPDATE_SIGN_UP_NUMBER_ERROR(3005, "支付修改报名人数异常"),

    COURSE_ORDER_NOT_EXIST(3006, "课程订单不存在"),

    MATERIAL_SETTLEMENT_NOT_EXIST(3007, "结算教具不存在"),

    MATERIAL_SETTLEMENT_STATUS_ERROR(3008, "结算教具状态错误"),

    TRANSFER_NOT_EXIST(3008, "转账信息不存在"),

    COURSE_SETTLEMENT_NOT_EXIST(3009, "结算课程不存在"),

    COURSE_SETTLEMENT_STATUS_ERROR(3010, "结算课程状态错误"),

    STUDENT_ORDER_ERROR(3011, "学生下单错误"),

    REACH_MAXIMUM_NUMBER(3012, "达到课程最大报名人数"),

    FEIGN_ERROR(3013, "远程调用课程服务失败"),

    REFUND_AMOUNT_GREATER_THAN_TOTAL_AMOUNT(3014, "退款金额大于订单总金额"),

    MATERIAL_ORDER_NOT_EXIST(3015, "教具订单不存在"),

    REFUND_AMOUNT_CAN_NOT_BE_ZERO(3016, "退款金额不能为0"),

    REFUND_ORDER_NOT_EXIST(3017, "退款订单不存在"),

    MATERIAL_MUST_BUY(3018, "教具必须购买"),

    /**
     * 不支持的渠道
     */
    PAY_CHANNEL_NOT_SUPPORT(3019, "不支持的渠道"),
    /**
     * 不支持的订单类型!
     */
    PAY_ORDER_TYPE_NOT_SUPPORT(3020, "不支持的订单类型!"),

    /**
     * 0元订单金额错误!
     */
    ZERO_ORDER_AMOUNT(3021, "0元订单金额错误"),

    GENERATE_WX_SIGN_ERROR(3022, "微信生成签名错误"),

    PAY_ERROR_16000(3023, "支付未知错误"),;


    private int code;
    private String msg;

    /**
     * 构造方法
     *
     * @param code    异常编码
     * @param message 异常信息
     * @author cyd
     * @since 2019-12-05
     */
    OrderExceptionEnum(int code, String message) {
        this.code = code;
        this.msg = message;
    }

    /**
     * 获取异常编码
     */
    @Override
    public Integer getCode() {
        return code;
    }

    /**
     * 获取异常信息
     */
    @Override
    public String getMsg() {
        return msg;
    }

}
